package xg2013.totoro.domain;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @generated
 */
@Entity
@Table(name = "notice")
public class Notice implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * @generated
	 */
	private String description;
	/**
	 * @generated
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	/**
	 * @generated
	 */
	@ManyToOne
	@JoinColumn(name = "issuerRole_id")
	private Role issuerRole;
	/**
	 * @generated
	 */
	@OneToMany(mappedBy = "notice",cascade = CascadeType.ALL)
	private Collection<NoticeToRole> noticeToRoles;
	/**
	 * @generated
	 */
	private Calendar issuedDate;
	/**
	 * @generated
	 */
	@Embedded
	private Attachment attachment;
	/**
	 * @generated
	 */
	private String title;

	/**
	 * @generated
	 */
	@ManyToOne
	@JoinColumn(name = "issuer_id")
	private Tutor issuer;

	/**
	 * @generated
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id 
	 * @generated
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @generated
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description 
	 * @generated
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @generated
	 */
	public Calendar getIssuedDate() {
		return issuedDate;
	}

	/**
	 * @generated
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title 
	 * @generated
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @param issuedDate 
	 * @generated
	 */
	public void setIssuedDate(Calendar issuedDate) {
		this.issuedDate = issuedDate;
	}

	public Role getIssuerRole() {
		return issuerRole;
	}

	public void setIssuerRole(Role issuerRole) {
		this.issuerRole = issuerRole;
	}

	public Collection<NoticeToRole> getNoticeToRoles() {
		return noticeToRoles;
	}

	public void setNoticeToRoles(Collection<NoticeToRole> noticeToRoles) {
		this.noticeToRoles = noticeToRoles;
	}

	public Attachment getAttachment() {
		return attachment;
	}

	public void setAttachment(Attachment attachment) {
		this.attachment = attachment;
	}

	public Tutor getIssuer() {
		return issuer;
	}

	public void setIssuer(Tutor issuer) {
		this.issuer = issuer;
	}
	
}